#ifndef XSUBMESH
#define XSUBMESH
#include "../XModEngine/XObject.h"
#include "../XModEngine/XComponent.h"
#include "../XModEngine/XIndexBuffer.h"
#include "../XModEngine/XVertexBuffer.h"
#include "../XModEngine/XTexture.h"
#include "../XModEngine/XMaterial.h"
#include "COMInclude.h"
class XC_ENTRY XSubMesh : public XObject
{
protected:
	XTexture* ptr_tex;
	XMaterial m_mat;
	struct Section{
	public:
		UINT m_vertex_count, m_vertex_prim_count, m_vertex_begin;
	};
public:
	vector<Section> m_sections;
	XSubMesh();
	~XSubMesh();

	bool Init();
	void Render();
	string ToString();

	void FillMesh(void* ptr_vert_data, int i_vert_len,void* ptr_index_data, int i_index_len);
	void SetTexture(string str_file);
	void SetMaterial(XMaterial material);
	void AddSection();
};
#endif

